package cn.wanho.dao;

import cn.wanho.dto.CmsExam;
import cn.wanho.rvo.ChooseVO;
import cn.wanho.rvo.QuestionVO;
import cn.wanho.rvo.TestCheckVO;
import org.apache.ibatis.annotations.Mapper;

import java.util.Date;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * @Author: FXP
 * @Date: 2022/08/04/9:48
 * @Description: 
 */
@Mapper
public interface CmsExamMapper {
    /**
     * 创建试卷
     * @param record the record
     * @return insert count
     */
    int insert(CmsExam record);

    /**
     * 展示试卷
     */
    List<ChooseVO> testing(Integer examId);

    /**
     * 显示选择题
     */
    List<ChooseVO> choose(Integer examId);

    /**
     * 填空题
     */
    List<QuestionVO> blank(Integer examId);

    /**
     * 判断题
     */
    List<QuestionVO> judge(Integer examId);

    /**
     * 程序题
     */
    List<QuestionVO> program(Integer examId);

    /**
     * delete by primary key
     * @param id primaryKey
     * @return deleteCount
     */
    int deleteByPrimaryKey(Integer id);

    /**
     * insert record to table selective
     * @param record the record
     * @return insert count
     */
    int insertSelective(CmsExam record);

    /**
     * select by primary key
     * @param id primary key
     * @return object by primary key
     */
    CmsExam selectByPrimaryKey(Integer id);

    /**
     * update record selective
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKeySelective(CmsExam record);

    /**
     * update record
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKey(CmsExam record);

    /**
     * 判断学生是否有考试并返回考试信息
     * @param studentId
     * @return
     */
    List<TestCheckVO> testCheck(Integer studentId);

    /**
     * 创建试卷
     * @param paperName
     * @param startTime2
     * @param endTime2
     * @return
     */
    //int createPaper(String paperName, Date startTime2, Date endTime2);
}